load("//bazel:macros.bzl", "exports_files_legacy")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

licenses(["notice"])

exports_files_legacy()

go_library(
    name = "codesize_lib",
    srcs = ["codesize.go"],
    importpath = "go.skia.org/skia/infra/bots/task_drivers/codesize",
    visibility = ["//visibility:private"],
    deps = [
        "@com_google_cloud_go_storage//:storage",
        "@org_golang_google_api//option",
        "@org_skia_go_infra//go/auth",
        "@org_skia_go_infra//go/exec",
        "@org_skia_go_infra//go/gcs",
        "@org_skia_go_infra//go/gcs/gcsclient",
        "@org_skia_go_infra//go/gerrit",
        "@org_skia_go_infra//go/gitiles",
        "@org_skia_go_infra//go/now",
        "@org_skia_go_infra//go/skerr",
        "@org_skia_go_infra//task_driver/go/lib/auth_steps",
        "@org_skia_go_infra//task_driver/go/lib/checkout",
        "@org_skia_go_infra//task_driver/go/td",
        "@org_skia_go_infra//task_scheduler/go/types",
    ],
)

go_binary(
    name = "codesize",
    embed = [":codesize_lib"],
    visibility = ["//visibility:public"],
)

go_test(
    name = "codesize_test",
    srcs = ["codesize_test.go"],
    embed = [":codesize_lib"],
    deps = [
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//mock",
        "@com_github_stretchr_testify//require",
        "@org_skia_go_infra//go/exec",
        "@org_skia_go_infra//go/gcs",
        "@org_skia_go_infra//go/gcs/test_gcsclient",
        "@org_skia_go_infra//go/gerrit",
        "@org_skia_go_infra//go/gerrit/testutils",
        "@org_skia_go_infra//go/git",
        "@org_skia_go_infra//go/git/testutils",
        "@org_skia_go_infra//go/gitiles",
        "@org_skia_go_infra//go/gitiles/testutils",
        "@org_skia_go_infra//go/mockhttpclient",
        "@org_skia_go_infra//go/now",
        "@org_skia_go_infra//go/testutils",
        "@org_skia_go_infra//go/util",
        "@org_skia_go_infra//task_driver/go/td",
        "@org_skia_go_infra//task_scheduler/go/types",
    ],
)
